/**
 * This class parcels the marshalled data from the servlet to the javascript client.
 */
package org.hackystat.ui.telemetryviewer.client.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * This class parcels the marshalled data from the servlet to the javascript client.
 * @author David J. Nickles
 *
 */
public class ProjectParcel implements IsSerializable {
  
  /** {@literal} DEFAULT style for this main panel. */  
  public static final String DEFAULT = "Default"; 
  
  private String name;
  private String description;
  private String owner;
  private String startTime;
  private String endTime;
  private Boolean selected;
  
  /** 
   *  This field is a List that must always contain Strings.
   *  
   *  @gwt.typeArgs <java.lang.String>
   */
  private List members;
  
  /** 
   *  This field is a List that must always contain Strings.
   *  
   *  @gwt.typeArgs <java.lang.String>
   */
  private List invitations;
  
  /** 
   *  This field is a List that must always contain Strings.
   *  
   *  @gwt.typeArgs <java.lang.String, java.lang.String>
   */
  private Map properties;
  
  /** 
   *  This field is a List that must always contain Strings.
   *  
   *  @gwt.typeArgs <java.lang.String>
   */
  private List uriPatterns;
  
  /**
   * @return the project's selection status.
   */
  public boolean isSelected() {
    return Boolean.TRUE.equals(this.selected);
  }
  
  /**
   * @param selected of the project.
   */
  public void setSelected(Boolean selected) {
    this.selected = selected;
  }
  
  /**
   * @return the project name.
   */
  public String getName() {
    return name;
  }
  
  /**
   * @param name of the project.
   */
  public void setName(String name) {
    this.name = name;
  }
  
  /**
   * @return the project description.
   */
  public String getDescription() {
    return description;
  }
  
  /**
   * @param description of the project.
   */
  public void setDescription(String description) {
    this.description = description;
  }
  
  /**
   * @return the project owner.
   */
  public String getOwner() {
    return owner;
  }
  
  /**
   * @param owner of the project.
   */
  public void setOwner(String owner) {
    this.owner = owner;
  }
  
  /**
   * @return the project start date.
   */
  public String getStartTime() {
    return startTime;
  }
  
  /**
   * @param startTime of the project.
   */
  public void setStartTime(String startTime) {
    this.startTime = startTime;
  }
  
  /**
   * @return the project end date.
   */
  public String getEndTime() {
    return endTime;
  }
  
  /**
   * @param endTime of the project.
   */
  public void setEndTime(String endTime) {
    this.endTime = endTime;
  }
  
  /**
   * @return a list of the project members.
   */
  public List getMembers() {
    return members;
  }
  
  /**
   * @param members list for the project.
   */
  public void setMembers(List members) {
    this.members = members;
  }
  
  /**
   * @return a list of the project invitations.
   */
  public List getInvitations() {
    return invitations;
  }
  
  /**
   * @param invitations list for the project.
   */
  public void setInvitations(List invitations) {
    this.invitations = invitations;
  }
  
  /**
   * @return an array of two lists for the project property keys and values.
   */
  public Map getProperties() {
    return properties;
  }
  
  /**
   * @param properties list for the project.
   */
  public void setProperties(Map properties) {
    this.properties = properties;
  }
  
  /**
   * @return a list of the uri-patterns for the project.
   */
  public List getUriPatterns() {
    return uriPatterns;
  }
  
  /**
   * @param uriPatterns list for the project.
   */
  public void setUriPatterns(List uriPatterns) {
    this.uriPatterns = uriPatterns;
  }
  
  /**
   * This method returns a string representation of the name of this project.
   * @return a string representation of the name of this project.
   */
  public String toString() {
    return "{" + this.name + "}";
  }

  /**
   * No parameters constructor.
   */
  public ProjectParcel() {
    super();
    this.name = "Name";
    this.description = "Description";
    this.owner = "Owner";
    this.startTime = "01-01-2008";
    this.endTime = "01-02-2008";
    this.selected = Boolean.FALSE;
    this.members = new ArrayList();
    this.invitations = new ArrayList();
    this.properties = new HashMap();
    this.uriPatterns = new ArrayList();
  }
}
